package com.kingint.mbg.bas.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;

import com.kingint.mbg.group.Insert;
import com.kingint.mbg.group.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;

/**
 * <p>
 * 维修物品相关表
 * </p>
 *
 * @author wxh
 * @since 2020-12-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="BasRepairGoods对象", description="维修物品相关表")
public class BasRepairGoods implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("pid")
    private Integer pid;

    @ApiModelProperty(value = "维修物品名称")
    @TableField("repair_name")
    @NotEmpty(groups = {Insert.class, Update.class},message = "维修物品名称不能为空")
    private String repairName;

    @ApiModelProperty(value = "单位")
    @TableField("unit")
    private String unit;

    @ApiModelProperty(value = "价格")
    @TableField("price")
    private BigDecimal price;

    @ApiModelProperty(value = "前台代码")
    @TableField("front_code")
    private String frontCode;

    @ApiModelProperty(value = "备注")
    @TableField("note")
    private String note;

    @ApiModelProperty(value = "库存")
    @TableField("stock")
    private Integer stock;

    @ApiModelProperty(value = "酒店id")
    @TableField("hotel_id")
    private Integer hotelId;

    @ApiModelProperty(value = "类型（1，耗材类，2，五金类）")
    @TableField("type")
    private Integer type;

    @TableField("create_time")
    private Date createTime;

    @ApiModelProperty(value = "状态（0，正常，1删除）")
    @TableField("status")
    private Integer status;


    @TableField(exist = false)
    private List<BasRepairGoods> repairGoodsList;

    /**
     * 对应消耗的数量
     */
    @TableField(exist = false)
    private Integer number=1;


}
